/* 
 * Copyright (c) 2019, CENTRIN.CIYUN.LTD. All rights reserved.
 */
package com.cory.boot.domain.chart;

import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 图形数据
 * @author xiongcong
 * @date 2019-04-09
 */
@Data
@NoArgsConstructor
public class Chart {
    private String key;     // 自定义的key，不是echarts的属性
    private String name;    // 自定义的名称，不是echarts的属性
    private Object series;
    private Legend legend;
    private Object xAxis;
    private Object yAxis;
    private Object title;
    
    public Chart(String name) {
        this.name = name;
    }
    
    public Chart(String key, String name) {
        this.key = key;
        this.name = name;
    }
    
    public Chart series(Series<?>... series) {
        this.series = series;
        return this;
    }
    
    public Chart legend(Legend legend) {
        this.legend = legend;
        return this;
    }
    
    public Chart xAxis(Axis... xAxis) {
        this.xAxis = xAxis;
        return this;
    }
    
    public Chart yAxis(Axis... yAxis) {
        this.yAxis = yAxis;
        return this;
    }
    
    public Chart title(com.cory.boot.domain.chart.Data<?>... title) {
        this.title = title;
        return this;
    }

    @JsonProperty("xAxis")
    public Object getxAxis() {
        return xAxis;
    }
    
    @JsonProperty("yAxis")
    public Object getyAxis() {
        return yAxis;
    }
}
